import java.util.Scanner;

public class DigitSum {
    public static void main(String[] args) {
    Scanner in = new Scanner(System.in);
    int n = in.nextInt();
    int ret = Digit(n);
    System.out.println(ret);

    }
    public static int Digit(int n) {
        if (n == 0)
            return 0;
        else
            return n%10 + Digit(n/10);
    }
}
